//
//  qiyexqTableViewCell.m
//  BAOASystem
//
//  Created by michael on 2018/2/28.
//  Copyright © 2018年 czd. All rights reserved.
//
#import "UIView+SCYCategory.h"

#import "qiyexqTableViewCell.h"
#import "UIColor+UIColor_Hex.h"
#define kScreenHeight (Device_Is_iPhoneX ? ([UIScreen mainScreen].bounds.size.height - kXBarHeight) : ([UIScreen mainScreen].bounds.size.height))

#define kScreenWidth ([UIScreen mainScreen].bounds.size.width)
@implementation qiyexqTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
  _view0 = [[UIView alloc]init];
    _view0.frame = CGRectZero;
       [self.contentView addSubview:_view0];
 _label = [[UILabel alloc]init];
    _label.frame = CGRectZero;
      [_label setFont:[UIFont systemFontOfSize:14]];
       [self.view0 addSubview:_label];
    _view1 = [[UIView alloc]init];
    _view1.frame = CGRectZero;
       [self.view0 addSubview:_view1];
  _view2 = [[UIView alloc]init];
    _view2.frame = CGRectZero;
       [self.view0 addSubview:_view2];
     _view3 = [[UIView alloc]init];
    _view3.frame = CGRectZero;
       [self.contentView addSubview:_view3];
       _label1 = [[UILabel alloc]init];
              _label1.numberOfLines = 0;

    _label1.frame = CGRectZero;
    _label1.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label1 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label1];
    
         _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
    _label2.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label2 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2];
    
                _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
        _label3.numberOfLines = 0;

    _label3.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label3 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label3];
    
                 _label4 = [[UILabel alloc]init];
    _label4.frame = CGRectZero;
            _label4.numberOfLines = 0;

    _label4.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label4 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label4];
    
          _label5 = [[UILabel alloc]init];
    _label5.frame = CGRectZero;
                _label5.numberOfLines = 0;

    _label5.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label5 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label5];
    
     _label6 = [[UILabel alloc]init];
    _label6.frame = CGRectZero;
                    _label6.numberOfLines = 0;

    _label6.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label6 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label6];
    
         _label7 = [[UILabel alloc]init];
    _label7.frame = CGRectZero;
                        _label7.numberOfLines = 0;

    _label7.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label7 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label7];
    
         _label8 = [[UILabel alloc]init];
    _label8.frame = CGRectZero;
                            _label8.numberOfLines = 0;

    _label8.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label8 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label8];
    
         _label9 = [[UILabel alloc]init];
    _label9.frame = CGRectZero;
                                _label9.numberOfLines = 0;

    _label9.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label9 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label9];
    
            _label1xq = [[UILabel alloc]init];
    _label1xq.frame = CGRectZero;
                                _label1xq.numberOfLines = 0;

    _label1xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label1xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label1xq];
    
         _label2xq = [[UILabel alloc]init];
    _label2xq.frame = CGRectZero;
                                    _label2xq.numberOfLines = 0;

    _label2xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label2xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2xq];
    
                _label3xq = [[UILabel alloc]init];
    _label3xq.frame = CGRectZero;
                                        _label3xq.numberOfLines = 0;

    _label3xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label3xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label3xq];
    
                 _label4xq = [[UILabel alloc]init];
             _label4xq.numberOfLines = 0;

    _label4xq.frame = CGRectZero;
    _label4xq.numberOfLines = 0;
    _label4xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label4xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label4xq];
    
          _label5xq = [[UILabel alloc]init];
    _label5xq.frame = CGRectZero;
                 _label5xq.numberOfLines = 0;

    _label5xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label5xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label5xq];
    
     _label6xq = [[UILabel alloc]init];
    _label6xq.frame = CGRectZero;
                     _label6xq.numberOfLines = 0;

    _label6xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label6xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label6xq];
    
         _label7xq = [[UILabel alloc]init];
    _label7xq.frame = CGRectZero;
                         _label7xq.numberOfLines = 0;

    _label7xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label7xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label7xq];
    
         _label8xq = [[UILabel alloc]init];
    _label8xq.frame = CGRectZero;
                             _label8xq.numberOfLines = 0;

    _label8xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label8xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label8xq];
    
         _label9xq = [[UILabel alloc]init];
    _label9xq.frame = CGRectZero;
                                 _label9xq.numberOfLines = 0;

    _label9xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label9xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label9xq];

}

return self;

}
- (void)layoutSubviews{

[super layoutSubviews];
  _view0.frame = CGRectMake(0, 0, kScreenWidth, 30);
    _view0.backgroundColor = [UIColor whiteColor];


  _view1.frame = CGRectMake(5, 5, 10, 20);
    _view1.backgroundColor = [UIColor colorWithHexString:@"0AA0F6"];

 _label.frame = CGRectMake(_view1.right+10,5, kScreenWidth-40, 20);
    _label.text  = NSLocalizedString(@"详细信息", nil);
    _label.textColor = [UIColor colorWithHexString:@"484848"];
   _label.font = [UIFont boldSystemFontOfSize:14];
   _view2.frame = CGRectMake(0,_view0.bottom+1, kScreenWidth, 1);
    _view2.backgroundColor = [UIColor colorWithHexString:@"f0eff5"];
     CGFloat height1 = [OAToolBox sizebyText:_dic[@"address"] font:13 minsWidth:120];
 CGFloat height2 = [OAToolBox sizebyText:_dic[@"websites"] font:13 minsWidth:120];
if (height1>31.5) {
        _label1.frame = CGRectMake(0, _view2.bottom, 120, 47);
    _label1xq.frame = CGRectMake(_label1.right, _view2.bottom, kScreenWidth-_label1.width, 47);

}else{
    _label1.frame = CGRectMake(0, _view2.bottom, 120, 32);
    _label1xq.frame = CGRectMake(_label1.right, _view2.bottom, kScreenWidth-_label1.width, 32);

}

if (height2>31.5) {
        _label1.frame = CGRectMake(0, _view2.bottom, 120, 47);
    _label1xq.frame = CGRectMake(_label1.right, _view2.bottom, kScreenWidth-_label1.width, 47);

}else{
    _label1.frame = CGRectMake(0, _view2.bottom, 120, 32);
    _label1xq.frame = CGRectMake(_label1.right, _view2.bottom, kScreenWidth-_label1.width, 32);

}
    _label2.frame = CGRectMake(0, _label1.bottom, 120, 32);
    _label3.frame = CGRectMake(0, _label2.bottom, 120, 32);
    _label4.frame = CGRectMake(0, _label3.bottom, 120, 32);
   
    
    _label2xq.frame = CGRectMake(_label1.right, _label1.bottom, kScreenWidth-_label1.width, 32);
    _label3xq.frame = CGRectMake(_label1.right, _label2.bottom, kScreenWidth-_label1.width, 32);
 CGFloat height = [OAToolBox sizebyText:_dic[@"businessScope"] font:13 minsWidth:120];

    _label4xq.frame = CGRectMake(_label1.right, _label3.bottom, kScreenWidth-_label1.width, 32);
    _label5xq.frame = CGRectMake(_label1.right, _label4xq.bottom, kScreenWidth-_label1.width, 32);
    _label6xq.frame = CGRectMake(_label1.right, _label5xq.bottom, kScreenWidth-_label1.width, 32);
    _label7xq.frame = CGRectMake(_label1.right, _label6xq.bottom, kScreenWidth-_label1.width, 32);
    
    if (height2>31.5) {
//        _label1.frame = CGRectMake(0, _view2.bottom, 120, 47);
    _label8xq.frame = CGRectMake(_label1.right, _label7xq.bottom, kScreenWidth-_label1.width, 47);

}else{
//    _label1.frame = CGRectMake(0, _view2.bottom, 120, 32);
    _label8xq.frame = CGRectMake(_label1.right, _label7xq.bottom, kScreenWidth-_label1.width, 32);

}
    _label9xq.frame = CGRectMake(_label1.right, _label8xq.bottom, kScreenWidth-_label1.width, 32);
     _view3.frame = CGRectMake(0,_label9xq.bottom, kScreenWidth, 10);
    _view3.backgroundColor = [UIColor colorWithHexString:@"f0eff5"];
     _label5.frame = CGRectMake(0, _label4xq.bottom, 120, 32);
    _label6.frame = CGRectMake(0, _label5.bottom, 120, 32);
    _label7.frame = CGRectMake(0, _label6.bottom, 120, 32);
     if (height2>31.5) {
    _label8.frame = CGRectMake(0, _label7.bottom, 120, 47);
//    _label8xq.frame = CGRectMake(_label1.right, _label7xq.bottom, kScreenWidth-_label1.width, 47);

}else{
    _label8.frame = CGRectMake(0, _label7.bottom, 120, 32);
//    _label8xq.frame = CGRectMake(_label1.right, _label7xq.bottom, kScreenWidth-_label1.width, 32);

}
    _label9.frame = CGRectMake(0, _label8.bottom, 120, 32);
_label1.text = NSLocalizedString(@"公司注册地址", nil);
_label2.text = NSLocalizedString(@"公司性质", nil);
_label3.text = NSLocalizedString(@"注册资本资金", nil);
_label4.text = NSLocalizedString(@"经营范围", nil);
_label5.text = NSLocalizedString(@"公司成立日期", nil);
_label6.text = NSLocalizedString(@"经营期限", nil);
_label7.text = NSLocalizedString(@"统一信用/注册号", nil);
_label8.text = NSLocalizedString(@"公司网站", nil);
_label9.text = NSLocalizedString(@"营业执照是否公开", nil);
NSDictionary * comdic = _dic;
_label1xq.text =comdic[@"address"];
_label2xq.text =comdic[@"type"];
_label3xq.text =[NSString stringWithFormat:@"%@",comdic[@"registeredCapital"]];
_label4xq.text =comdic[@"businessScope"];
_label5xq.text =comdic[@"registerDate"];
_label6xq.text =[NSString stringWithFormat:@"%@-%@",comdic[@"startDate"],comdic[@"endDate"]];
_label7xq.text =comdic[@"registeredNo"];
_label8xq.text =comdic[@"websites"];
if(comdic[@"isOpen"]){
_label9xq.text =NSLocalizedString(@"是", nil);
}else{
_label9xq.text =NSLocalizedString(@"否", nil);

}

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
